{% block sw_settings_listing_option_base %}
<sw-page class="sw-settings-listing-base">
    {% block sw_settings_listing_option_base_smart_bar_heading %}
    <template #smart-bar-header>
        <h2>{{ smartBarHeading }}</h2>
    </template>
    {% endblock %}

    {% block sw_settings_listing_option_base_language_switch %}
    <template #language-switch>
        <sw-language-switch @on-change="onChangeLanguage" />
    </template>
    {% endblock %}

    {% block sw_settings_listing_option_base_smart_bar_actions %}
    <template #smart-bar-actions>

        {% block sw_settings_listing_option_base_smart_bar_actions_save %}
        <mt-button
            variant="primary"
            :disabled="isSaveButtonDisabled"
            size="default"
            @click="onSave"
        >
            {{ $t('global.default.save') }}
        </mt-button>
        {% endblock %}
    </template>
    {% endblock %}

    {% block sw_settings_listing_option_base_smart_content %}
    <template #content>

        {% block sw_settings_listing_option_base_smart_content_general_info %}
        <sw-settings-listing-option-general-info
            v-if="productSortingEntity"
            :sorting-option="productSortingEntity"
            :is-default-sorting="isDefaultSorting"
            :label-error="sortingOptionLabelError"
            :technical-name-error="sortingOptionTechnicalNameError"
        />
        {% endblock %}

        {% block sw_settings_listing_option_base_smart_bar_actions_grid %}
        <sw-settings-listing-option-criteria-grid
            v-if="productSortingEntity"
            :product-sorting-entity="productSortingEntity"
            @criteria-delete="onDeleteCriteria"
            @criteria-add="onAddCriteria"
            @inline-edit-save="onSave"
            @inline-edit-cancel="onCancelEditCriteria"
        />
        {% endblock %}

        {% block sw_settings_listing_option_base_smart_bar_actions_grid_delete_modal %}
        <sw-settings-listing-delete-modal
            v-if="toBeDeletedCriteria"
            :title="$tc('sw-settings-listing.base.delete.modalTitle')"
            :description="$tc('sw-settings-listing.base.delete.modalDescription')"
            @cancel="toBeDeletedCriteria = null"
            @delete="onConfirmDeleteCriteria"
        />
        {% endblock %}
    </template>
    {% endblock %}
</sw-page>
{% endblock %}
